home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / QD3DErrors.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  11.3 KB  |  335 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QD3DErrors.h
  3.  
  4.      Contains:    Error API and error codes                                        
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QD3DERRORS__
  18. #define __QD3DERRORS__
  19.  
  20. #ifndef __QD3D__
  21. #include <QD3D.h>
  22. #endif
  23.  
  24. #if TARGET_OS_MAC
  25. #ifndef __MACTYPES__
  26. #include <MacTypes.h>
  27. #endif
  28. #endif  /* TARGET_OS_MAC */
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=power
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. #if PRAGMA_ENUM_ALWAYSINT
  53.     #pragma enumsalwaysint on
  54. #elif PRAGMA_ENUM_OPTIONS
  55.     #pragma option enum=int
  56. #elif PRAGMA_ENUM_PACK
  57.     #if __option(pack_enums)
  58.         #define PRAGMA_ENUM_PACK__QD3DERRORS__
  59.     #endif
  60.     #pragma options(!pack_enums)
  61. #endif
  62.  
  63. /******************************************************************************
  64.  **                                                                             **
  65.  **                            Error Types and Codes                             **
  66.  **                                                                             **
  67.  *****************************************************************************/
  68.  
  69. enum TQ3Error {
  70.     kQ3ErrorNone                = 0,                            /* Fatal Errors */
  71.     kQ3ErrorInternalError        = -28500,
  72.     kQ3ErrorNoRecovery            = -28499,
  73.     kQ3ErrorLastFatalError        = -28498,                        /* System Errors */
  74.     kQ3ErrorNotInitialized        = -28490,
  75.     kQ3ErrorAlreadyInitialized    = -28489,
  76.     kQ3ErrorUnimplemented        = -28488,
  77.     kQ3ErrorRegistrationFailed    = -28487,                        /* OS Errors */
  78.     kQ3ErrorUnixError            = -28486,
  79.     kQ3ErrorMacintoshError        = -28485,
  80.     kQ3ErrorX11Error            = -28484,                        /* Memory Errors */
  81.     kQ3ErrorMemoryLeak            = -28483,
  82.     kQ3ErrorOutOfMemory            = -28482,                        /* Parameter errors */
  83.     kQ3ErrorNULLParameter        = -28481,
  84.     kQ3ErrorParameterOutOfRange    = -28480,
  85.     kQ3ErrorInvalidParameter    = -28479,
  86.     kQ3ErrorInvalidData            = -28478,
  87.     kQ3ErrorAcceleratorAlreadySet = -28477,
  88.     kQ3ErrorVector3DNotUnitLength = -28476,
  89.     kQ3ErrorVector3DZeroLength    = -28475,                        /* Object Errors */
  90.     kQ3ErrorInvalidObject        = -28474,
  91.     kQ3ErrorInvalidObjectClass    = -28473,
  92.     kQ3ErrorInvalidObjectType    = -28472,
  93.     kQ3ErrorInvalidObjectName    = -28471,
  94.     kQ3ErrorObjectClassInUse    = -28470,
  95.     kQ3ErrorAccessRestricted    = -28469,
  96.     kQ3ErrorMetaHandlerRequired    = -28468,
  97.     kQ3ErrorNeedRequiredMethods    = -28467,
  98.     kQ3ErrorNoSubClassType        = -28466,
  99.     kQ3ErrorUnknownElementType    = -28465,
  100.     kQ3ErrorNotSupported        = -28464,                        /* Extension Errors */
  101.     kQ3ErrorNoExtensionsFolder    = -28463,
  102.     kQ3ErrorExtensionError        = -28462,
  103.     kQ3ErrorPrivateExtensionError = -28461,                        /* Geometry Errors */
  104.     kQ3ErrorDegenerateGeometry    = -28460,
  105.     kQ3ErrorGeometryInsufficientNumberOfPoints = -28459,        /* IO Errors */
  106.     kQ3ErrorNoStorageSetForFile    = -28458,
  107.     kQ3ErrorEndOfFile            = -28457,
  108.     kQ3ErrorFileCancelled        = -28456,
  109.     kQ3ErrorInvalidMetafile        = -28455,
  110.     kQ3ErrorInvalidMetafilePrimitive = -28454,
  111.     kQ3ErrorInvalidMetafileLabel = -28453,
  112.     kQ3ErrorInvalidMetafileObject = -28452,
  113.     kQ3ErrorInvalidMetafileSubObject = -28451,
  114.     kQ3ErrorInvalidSubObjectForObject = -28450,
  115.     kQ3ErrorUnresolvableReference = -28449,
  116.     kQ3ErrorUnknownObject        = -28448,
  117.     kQ3ErrorStorageInUse        = -28447,
  118.     kQ3ErrorStorageAlreadyOpen    = -28446,
  119.     kQ3ErrorStorageNotOpen        = -28445,
  120.     kQ3ErrorStorageIsOpen        = -28444,
  121.     kQ3ErrorFileAlreadyOpen        = -28443,
  122.     kQ3ErrorFileNotOpen            = -28442,
  123.     kQ3ErrorFileIsOpen            = -28441,
  124.     kQ3ErrorBeginWriteAlreadyCalled = -28440,
  125.     kQ3ErrorBeginWriteNotCalled    = -28439,
  126.     kQ3ErrorEndWriteNotCalled    = -28438,
  127.     kQ3ErrorReadStateInactive    = -28437,
  128.     kQ3ErrorStateUnavailable    = -28436,
  129.     kQ3ErrorWriteStateInactive    = -28435,
  130.     kQ3ErrorSizeNotLongAligned    = -28434,
  131.     kQ3ErrorFileModeRestriction    = -28433,
  132.     kQ3ErrorInvalidHexString    = -28432,
  133.     kQ3ErrorWroteMoreThanSize    = -28431,
  134.     kQ3ErrorWroteLessThanSize    = -28430,
  135.     kQ3ErrorReadLessThanSize    = -28429,
  136.     kQ3ErrorReadMoreThanSize    = -28428,
  137.     kQ3ErrorNoBeginGroup        = -28427,
  138.     kQ3ErrorSizeMismatch        = -28426,
  139.     kQ3ErrorStringExceedsMaximumLength = -28425,
  140.     kQ3ErrorValueExceedsMaximumSize = -28424,
  141.     kQ3ErrorNonUniqueLabel        = -28423,
  142.     kQ3ErrorEndOfContainer        = -28422,
  143.     kQ3ErrorUnmatchedEndGroup    = -28421,
  144.     kQ3ErrorFileVersionExists    = -28420,                        /* View errors */
  145.     kQ3ErrorViewNotStarted        = -28419,
  146.     kQ3ErrorViewIsStarted        = -28418,
  147.     kQ3ErrorRendererNotSet        = -28417,
  148.     kQ3ErrorRenderingIsActive    = -28416,
  149.     kQ3ErrorImmediateModeUnderflow = -28415,
  150.     kQ3ErrorDisplayNotSet        = -28414,
  151.     kQ3ErrorCameraNotSet        = -28413,
  152.     kQ3ErrorDrawContextNotSet    = -28412,
  153.     kQ3ErrorNonInvertibleMatrix    = -28411,
  154.     kQ3ErrorRenderingNotStarted    = -28410,
  155.     kQ3ErrorPickingNotStarted    = -28409,
  156.     kQ3ErrorBoundsNotStarted    = -28408,
  157.     kQ3ErrorDataNotAvailable    = -28407,
  158.     kQ3ErrorNothingToPop        = -28406,                        /* Renderer Errors */
  159.     kQ3ErrorUnknownStudioType    = -28405,
  160.     kQ3ErrorAlreadyRendering    = -28404,
  161.     kQ3ErrorStartGroupRange        = -28403,
  162.     kQ3ErrorUnsupportedGeometryType = -28402,
  163.     kQ3ErrorInvalidGeometryType    = -28401,
  164.     kQ3ErrorUnsupportedFunctionality = -28400,                    /* Group Errors */
  165.     kQ3ErrorInvalidPositionForGroup = -28399,
  166.     kQ3ErrorInvalidObjectForGroup = -28398,
  167.     kQ3ErrorInvalidObjectForPosition = -28397,                    /* Transform Errors */
  168.     kQ3ErrorScaleOfZero            = -28396,                        /* String Errors */
  169.     kQ3ErrorBadStringType        = -28395,                        /* Attribute Errors */
  170.     kQ3ErrorAttributeNotContained = -28394,
  171.     kQ3ErrorAttributeInvalidType = -28393,                        /* Camera Errors */
  172.     kQ3ErrorInvalidCameraValues    = -28392,                        /* DrawContext Errors */
  173.     kQ3ErrorBadDrawContextType    = -28391,
  174.     kQ3ErrorBadDrawContextFlag    = -28390,
  175.     kQ3ErrorBadDrawContext        = -28389,
  176.     kQ3ErrorUnsupportedPixelDepth = -28388,                        /* Controller Errors */
  177.     kQ3ErrorController            = -28387,                        /* Tracker Errors */
  178.     kQ3ErrorTracker                = -28386,                        /* Another OS Error */
  179.     kQ3ErrorWin32Error            = -28385,                        /* Object Errors */
  180.     kQ3ErrorTypeAlreadyExistsAndHasSubclasses = -28384,
  181.     kQ3ErrorTypeAlreadyExistsAndOtherClassesDependOnIt = -28383,
  182.     kQ3ErrorTypeAlreadyExistsAndHasObjectInstances = -28382,    /* submit loop errors: if you ever get one of these check the previous*/
  183.                                                                 /* error posted, it may be kQ3ErrorOutOfMemory.  If so you *may* be able*/
  184.                                                                 /* to recover by freeing up some memory and trying again*/
  185.     kQ3ErrorPickingLoopFailed    = -28381,
  186.     kQ3ErrorRenderingLoopFailed    = -28380,
  187.     kQ3ErrorWritingLoopFailed    = -28379,
  188.     kQ3ErrorBoundingLoopFailed    = -28378
  189. };
  190. typedef enum TQ3Error TQ3Error;
  191.  
  192.  
  193. enum TQ3Warning {
  194.     kQ3WarningNone                = 0,                            /* General System */
  195.     kQ3WarningInternalException    = -28300,                        /* Object Warnings */
  196.     kQ3WarningNoObjectSupportForDuplicateMethod = -28299,
  197.     kQ3WarningNoObjectSupportForDrawMethod = -28298,
  198.     kQ3WarningNoObjectSupportForWriteMethod = -28297,
  199.     kQ3WarningNoObjectSupportForReadMethod = -28296,
  200.     kQ3WarningUnknownElementType = -28295,
  201.     kQ3WarningTypeAndMethodAlreadyDefined = -28294,
  202.     kQ3WarningTypeIsOutOfRange    = -28293,
  203.     kQ3WarningTypeHasNotBeenRegistered = -28292,                /* Parameter Warnings */
  204.     kQ3WarningVector3DNotUnitLength = -28291,                    /* IO Warnings */
  205.     kQ3WarningInvalidSubObjectForObject = -28290,
  206.     kQ3WarningInvalidHexString    = -28289,
  207.     kQ3WarningUnknownObject        = -28288,
  208.     kQ3WarningInvalidMetafileObject = -28287,
  209.     kQ3WarningUnmatchedBeginGroup = -28286,
  210.     kQ3WarningUnmatchedEndGroup    = -28285,
  211.     kQ3WarningInvalidTableOfContents = -28284,
  212.     kQ3WarningUnresolvableReference = -28283,
  213.     kQ3WarningNoAttachMethod    = -28282,
  214.     kQ3WarningInconsistentData    = -28281,
  215.     kQ3WarningReadLessThanSize    = -28280,
  216.     kQ3WarningFilePointerResolutionFailed = -28279,
  217.     kQ3WarningFilePointerRedefined = -28278,
  218.     kQ3WarningStringExceedsMaximumLength = -28277,                /* Memory Warnings */
  219.     kQ3WarningLowMemory            = -28276,
  220.     kQ3WarningPossibleMemoryLeak = -28275,                        /* View Warnings */
  221.     kQ3WarningViewTraversalInProgress = -28274,
  222.     kQ3WarningNonInvertibleMatrix = -28273,                        /* Quaternion Warning */
  223.     kQ3WarningQuaternionEntriesAreZero = -28272,                /* Renderer Warning */
  224.     kQ3WarningFunctionalityNotSupported = -28271,                /* DrawContext Warning */
  225.     kQ3WarningInvalidPaneDimensions = -28270,                    /* Pick Warning */
  226.     kQ3WarningPickParamOutside    = -28269,                        /* Scale Warnings */
  227.     kQ3WarningScaleEntriesAllZero = -28268,
  228.     kQ3WarningScaleContainsNegativeEntries = -28267,            /* Generic Warnings */
  229.     kQ3WarningParameterOutOfRange = -28266,                        /* Extension Warnings */
  230.     kQ3WarningExtensionNotLoading = -28265,                        /* Object Warnings */
  231.     kQ3WarningTypeAlreadyRegistered = -28264,
  232.     kQ3WarningTypeSameVersionAlreadyRegistered = -28263,
  233.     kQ3WarningTypeNewerVersionAlreadyRegistered = -28262,        /* Invalid Group Object */
  234.     kQ3WarningInvalidObjectInGroupMetafile = -28261
  235. };
  236. typedef enum TQ3Warning TQ3Warning;
  237.  
  238.  
  239.  
  240. enum TQ3Notice {
  241.     kQ3NoticeNone                = 0,
  242.     kQ3NoticeDataAlreadyEmpty    = -28100,
  243.     kQ3NoticeMethodNotSupported    = -28099,
  244.     kQ3NoticeObjectAlreadySet    = -28098,
  245.     kQ3NoticeParameterOutOfRange = -28097,
  246.     kQ3NoticeFileAliasWasChanged = -28096,
  247.     kQ3NoticeMeshVertexHasNoComponent = -28095,
  248.     kQ3NoticeMeshInvalidVertexFacePair = -28094,
  249.     kQ3NoticeMeshEdgeVertexDoNotCorrespond = -28093,
  250.     kQ3NoticeMeshEdgeIsNotBoundary = -28092,
  251.     kQ3NoticeDrawContextNotSetUsingInternalDefaults = -28091,
  252.     kQ3NoticeInvalidAttenuationTypeUsingInternalDefaults = -28090,
  253.     kQ3NoticeBrightnessGreaterThanOne = -28089,
  254.     kQ3NoticeScaleContainsZeroEntries = -28088,
  255.     kQ3NoticeSystemAlreadyInitialized = -28087,
  256.     kQ3NoticeViewSyncCalledAgain = -28086,
  257.     kQ3NoticeFileCancelled        = -28085
  258. };
  259. typedef enum TQ3Notice TQ3Notice;
  260.  
  261. typedef CALLBACK_API_C( void , TQ3ErrorMethod )(TQ3Error firstError, TQ3Error lastError, long reference);
  262. typedef CALLBACK_API_C( void , TQ3WarningMethod )(TQ3Warning firstWarning, TQ3Warning lastWarning, long reference);
  263. typedef CALLBACK_API_C( void , TQ3NoticeMethod )(TQ3Notice firstNotice, TQ3Notice lastNotice, long reference);
  264. /******************************************************************************
  265.  **                                                                             **
  266.  **                                Error Routines                                 **
  267.  **                                                                             **
  268.  *****************************************************************************/
  269. EXTERN_API_C( TQ3Status )
  270. Q3Error_Register                (TQ3ErrorMethod         errorPost,
  271.                                  long                     reference);
  272.  
  273. EXTERN_API_C( TQ3Status )
  274. Q3Warning_Register                (TQ3WarningMethod         warningPost,
  275.                                  long                     reference);
  276.  
  277. EXTERN_API_C( TQ3Status )
  278. Q3Notice_Register                (TQ3NoticeMethod         noticePost,
  279.                                  long                     reference);
  280.  
  281. /*
  282.  *  Getting error codes -
  283.  *    Clears error type on next entry into system (except all of these 
  284.  *  error calls), and returns the last error, and optionally the 
  285.  *    first error. The parameter to these "_Get" calls may be NULL.
  286.  */
  287. EXTERN_API_C( TQ3Error )
  288. Q3Error_Get                        (TQ3Error *                firstError);
  289.  
  290. EXTERN_API_C( TQ3Boolean )
  291. Q3Error_IsFatalError            (TQ3Error                 error);
  292.  
  293. EXTERN_API_C( TQ3Warning )
  294. Q3Warning_Get                    (TQ3Warning *            firstWarning);
  295.  
  296. EXTERN_API_C( TQ3Notice )
  297. Q3Notice_Get                    (TQ3Notice *            firstNotice);
  298.  
  299. #if TARGET_OS_MAC
  300. EXTERN_API_C( OSErr )
  301. Q3MacintoshError_Get            (OSErr *                firstMacErr);
  302.  
  303. #endif  /* TARGET_OS_MAC */
  304.  
  305.  
  306.  
  307. #if PRAGMA_ENUM_ALWAYSINT
  308.     #pragma enumsalwaysint reset
  309. #elif PRAGMA_ENUM_OPTIONS
  310.     #pragma option enum=reset
  311. #elif defined(PRAGMA_ENUM_PACK__QD3DERRORS__)
  312.     #pragma options(pack_enums)
  313. #endif
  314.  
  315. #if PRAGMA_STRUCT_ALIGN
  316.     #pragma options align=reset
  317. #elif PRAGMA_STRUCT_PACKPUSH
  318.     #pragma pack(pop)
  319. #elif PRAGMA_STRUCT_PACK
  320.     #pragma pack()
  321. #endif
  322.  
  323. #ifdef PRAGMA_IMPORT_OFF
  324. #pragma import off
  325. #elif PRAGMA_IMPORT
  326. #pragma import reset
  327. #endif
  328.  
  329. #ifdef __cplusplus
  330. }
  331. #endif
  332.  
  333. #endif /* __QD3DERRORS__ */
  334.  
  335.